import React, {Component} from 'react'
import {
    BrowserRouter as Router,
    Route,
    Switch
} from 'react-router-dom';
import {renderRoutes} from 'react-router-config'

import App from '$components/app/app'
import Ducks from '$containers/ducks/ducks'
import Counter from '$containers/counter/counter'
import Test from '$containers/test/test'

const routers = [
    {
        component: App,
        routes: [
            {
                path: '/',
                exact: true,
                component: Ducks,
                routes: [
                    // {
                    //     path: '/counter/details/:id?',
                    //     component: Details
                    // }
                ]
            },
            {
                path: '/test',
                component: Test,
                routes: [
                    // {
                    //     path: '/counter/details/:id?',
                    //     component: Details
                    // }
                ]
            },
            {
                path: '/counter',
                component: Counter,
                routes: [
                    // {
                    //     path: '/counter/details/:id?',
                    //     component: Details
                    // }
                ]
            }
        ]
    }
    // ,
    // {
    //     path: '*',
    //     component: Error404
    // }
]

class Routers extends Component {
    constructor(props) {
        super(props);
    }

    render() {
        return (
            <Router>
                {renderRoutes(routers)}
            </Router>
        )
    }
}

export default Routers